package Compete1;

import java.util.Arrays;
import java.util.Scanner;

public class test {
    static int N=6;
    public static double assess(double[] scores)
    {
        double min= Arrays.stream(scores).min().getAsDouble();
        double max= Arrays.stream(scores).max().getAsDouble();
        double sum=0.0;
        for(double d : scores)
            sum+=d;
        double average =(sum-min-max)/(N-2);
        return average;
    }
    public static void main(String[] args) {
        assert (N>2);
        double[] judges=new double[N];
        Scanner sc = new Scanner(System.in);
        for(int i=0;i<judges.length;i++)
        {
            judges[i]=sc.nextDouble();
        }
        double score=assess(judges);
        System.out.println(score);
    }
}
